  <script type="text/javascript" src="../Public/js/ajax.js"></script>
  <!-- 共用头部1 -->
	 <div id="top">
		 <div class="head1 clear">
			 <div class="account sprite_icon" style="text-align:center; ">
                  <a href="index.php?g=Mobile&m=User&a=index" style=" color:#FFF; line-height:50px">
                 {if cookie('username')}
                  {php $user=M('User')->field('username')->where('id='.$jgsatuserid)->find()}
                  {php echo $user['username']} 
                 {else}登录
                 {/if}
                 </a>
			 </div>
			 {if $title}
			    <div class="title">{$title}</div> 
               {else}
                <div class="title">{$seo_title}</div> 
               {/if}<div class="search sprite_icon">
			     <span class="icon2 icon_com">
			 </div>
		 </div>
	 </div>         
<!-- banner -->
	  <YP:flash flashid="41" key="kid" />

<!-- nav -->
	 <div class="nav P_color">
		 <ul class="clear">
			 
			 <li>
				 <a href="index.php?g=Mobile&m=Case&a=index&id=2">
					 <div class="pic">
						 <img src="../Public/images/nav_pic2.png" alt="" />
					 </div>
					 <div class="info">
						 <span>效果图</span>
					 </div>
				 </a>
			 </li>
			 <li>
				 <a href="index.php?g=Mobile&m=Case&a=index&id=1">
					 <div class="pic">
						 <img src="../Public/images/nav_pic3.png" alt="" />
					 </div>
					 <div class="info">
						 <span>案例图</span>
					 </div>
				 </a>
			 </li>
			 <li>
				 <a href="index.php?g=Mobile&m=News&a=index&id=3">
					 <div class="pic">
						 <img src="../Public/images/nav_pic4.png" alt="" />
					 </div>
					 <div class="info">
						 <span>餐饮攻略</span>
					 </div>
				 </a>
			 </li>
			 <li>
				<a href="index.php?g=Mobile&m=Yuyue&a=index&id=4">
					 <div class="pic">
						 <img src="../Public/images/nav_pic5.png" alt="" />
					 </div>
					 <div class="info">
						 <span>找设计师</span>
					 </div>
				 </a>
			 </li>
			 
			 
			 
		 </ul>
	 </div>

<!-- 最新需求 -->
   <div class="lastest_need P_com_mod P_border P_color">
         <div class="fl">
             <strong>最新需求</strong>
         </div>
         <YP:list name="Guestbook" status="1" order="id desc" limit="1" id="r">
         <div class="wrap fl">
             <div class="scroll">
               <a href="/index.php?g=Mobile&m=Guestbook&a=show&id={$r['id']}">
                 <div class="info">
                     <div class="tittle"> {$r['bprovince']|jgarea=###} {$r['bcity']|jgarea=###}{$r['itemArea']}{$r['itemType']}设计</div>
                     <ul class="supply clear">
                         <li class="no_padding_left"> {$r['bprovince']|jgarea=###} </li>
                         <li>{$r['itemType']}</li>
                         <li>{$r['itemArea']}</li>
                         <li class="no_border">￥{$r['budget']}</li>
                        
                     </ul>
                     <em style="float:right">{$r['createtime']|date="Y-m-d",###}</em>
                 </div>
                </a> 
             </div>
         </div>
         </YP:list>
     </div>

<!-- tab切换 -->
	 <div class="tab_veiwport" id="wrapper">
		 <ul class="I_tab P_color P_border clear">
			 <li class="active">
				 <a href="#a" class="topLink">设计师推荐</a>
			 </li>
			 <li style="display:none">
				 <a href="#b" class="topLink">供应商推荐</a>
			 </li>
			 <li>
				 <a href="#c" class="topLink">效果图推荐</a>
			 </li>
			 <li>
				 <a href="#d" class="topLink">案例图推荐</a>
			 </li>
			 <li>
				 <a href="#e" class="topLink">餐饮设备推荐</a>
			 </li>
			 <li>
				 <a href="#f" class="topLink">餐饮攻略推荐</a>
			 </li>
			 <li>
				 <a href="#g" class="topLink">新闻动态</a>
			 </li>
			 <li>
				 <a href="#h" class="topLink">问答推荐</a>
			 </li>
		 </ul>
	 </div>
     

<!-- tab锚点(共用) 1-->
     <div class="anchor" id="a">
         <div class="point clear">
             <div class="line"></div>
             <div class="sprite_icon Icon">
                 <span class="Icon1 icon_com"></span>
             </div>
             <div class="mes">设计师推荐</div>
             <div class="line line2"></div>
         </div>
     </div>

<!-- 内容 1-->
   <style>
.mod .P_com_mod .fl img{ height:40px;}
.mod .P_com_mod .ld {margin-top:0px;}   
   </style>  

 <div id="content1">    
{php $reluts=M('User')->where('groupid=1 and status=1 and posid=1')->order("pos_time desc")->limit('3')->select();
          foreach($reluts as $k=>$r):}
     <div class="mod mod1 P_color">
         <div class="P_com_mod clear">
             <div class="fl pic ld">
                  <a href="index.php?g=Mobile&m=Homepage&a=index&id={$r['id']}">{if $r['avatar']}<img src="{$r.avatar}" alt="" />{else}
                    <img src="../Public/images/effect_pic5.jpg" alt="" />
                  {/if}</a>
             </div>
             <div class="info">
                 <div class="tittle"> <a href="index.php?g=Mobile&m=Homepage&a=index&id={$r['id']}">{$r['username']}</a><a href="index.php?g=Mobile&m=Guestbookadd&a=index&designid={$r['id']}" class="bespoke">预约他<!--这里的ajax也要改--></a></div>
                 <ul class="supply clear">
                     <li class="no_padding_left">所在地:{$r['province']|jgarea=###} {$r['city']|jgarea=###}</li>
                      {php $itemType=explode(",",$r['itemType']);}
                     <li>擅长:
                          <YP:list name="Label" where="genre=17" key="kk" id="v" limit="50">
                                           {if in_array($v['id'],$itemType)}
                                              {$v['title']} {php break ;}
                                           {/if}
                          </YP:list>
                     
                     </li>
                     <li class="no_border no_padding_right">价格:
                        <YP:list name="Type" order="typeid" where="keyid=34" id="val" limit="50">
                            <?php echo $r['charge'] == $val['typeid'] ? $val['name'] : ''; ?>
                        </YP:list>/m²</li>
                 </ul>
             </div>
         </div>
         <div class="img clear">
         {php  $arr=M('Case')->field('id,pic')->where("userid=".$r['id']." and status=1")->limit('2')->select();}
         {php foreach($arr as $k=>$v):}
             <div class="pic {if $k==1}no_margin{/if}">
                 <a href="/index.php?g=Mobile&m=Case&a=show&id={$v['id']}"><img src="{$v['pic']}" alt="" /></a>
             </div>
          {php endforeach;}
         </div>
     </div>
{php endforeach;}

</div>

     <div class="P_mod_btn" id="designer">
         <a href="index.php?g=Mobile&m=Ajax&a=designer">点击加载下3条</a>
     </div>

<!-- tab锚点(共用) 2-->
     <div class="anchor" id="b" style="display:none">
         <div class="point clear">
             <div class="line"></div>
             <div class="sprite_icon Icon">
                 <span class="Icon2 icon_com"></span>
             </div>
             <div class="mes">供应商推荐</div>
             <div class="line line2"></div>
         </div>
     </div>

<!-- 内容
     <div class="mod mod1 P_color" style="display:none">
         <div class="P_com_mod clear">
             <div class="fl pic">
                 <img src="../Public/images/mod_pic4.png" alt="" />
             </div>
             <div class="info">
                 <div class="tittle">宜家工艺</div>
                 <ul class="supply clear">
                     <li class="no_padding_left">商品：25</li>
                     <li class="no_border">主营产品：餐桌 餐具</li>
                 </ul>
             </div>
         </div>
         <div class="img clear">
             <div class="pic">
                 <img src="../Public/images/mod_pic5.png" alt="" />
             </div>
             <div class="pic no_margin">
                 <img src="../Public/images/mod_pic5.png" alt="" />
             </div>
         </div>
     </div>

     <div class="mod mod1 P_color">
         <div class="P_com_mod clear">
             <div class="fl pic">
                 <img src="../Public/images/mod_pic4.png" alt="" />
             </div>
             <div class="info">
                 <div class="tittle">宜家工艺</div>
                 <ul class="supply clear">
                     <li class="no_padding_left">商品：25</li>
                     <li class="no_border">主营产品：餐桌 餐具</li>
                 </ul>
             </div>
         </div>
         <div class="img clear">
             <div class="pic">
                 <img src="../Public/images/mod_pic5.png" alt="" />
             </div>
             <div class="pic no_margin">
                 <img src="../Public/images/mod_pic5.png" alt="" />
             </div>
         </div>
     </div>

     <div class="mod mod1 P_color">
         <div class="P_com_mod clear">
             <div class="fl pic">
                 <img src="../Public/images/mod_pic4.png" alt="" />
             </div>
             <div class="info">
                 <div class="tittle">宜家工艺</div>
                 <ul class="supply clear">
                     <li class="no_padding_left">商品：25</li>
                     <li class="no_border">主营产品：餐桌 餐具</li>
                 </ul>
             </div>
         </div>
         <div class="img clear">
             <div class="pic">
                 <img src="../Public/images/mod_pic5.png" alt="" />
             </div>
             <div class="pic no_margin">
                 <img src="../Public/images/mod_pic5.png" alt="" />
             </div>
         </div>
     </div>

     <div class="P_mod_btn">
         <a href="javascript:;">点击加载下5条</a> 
     </div>
 2-->
<!-- tab锚点(共用) 3-->
     <div class="anchor" id="c">
         <div class="point clear">
             <div class="line"></div>
             <div class="sprite_icon Icon">
                 <span class="Icon3 icon_com"></span>
             </div>
             <div class="mes">效果图推荐</div>
             <div class="line line2"></div>
         </div>
     </div>

<!-- 内容 3-->

     <div class="P_mod_effect_catering" >
         <ul class="list clear" id="content2">
             
          <YP:list name="Case"  id="r" key="k" where="status=1 and posid=1 and catid=2" limit="4"> 
             <li class="part no_margin {if $k%2!=0}no_margin {/if}">
                 <div class="padding">
                     <div class="pic">
                         <a href="index.php?g=Mobile&m=Case&a=show&id={$r['id']}"><img src="{$r['thumb_list']}" alt="" /></a>
                     </div>
                     <div class="info"><a href="index.php?g=Mobile&m=Case&a=show&id={$r['id']}">{$r['title']|str_cut=###,10}</a><span>{$r['createtime']|date="m-d",###}</span>
                     </div>
                     <div class="sprite_icon sociality clear">
                         <a href="javascript:;">
                             <span class="icon_com icon4"></span><i>{$r['hits']}</i>
                         </a>
                         <a href="javascript:;">
                             <span class="icon_com icon5"></span><i>{$r['com_num']}</i>
                         </a>
                         <a href="javascript:onclick=keep({$r['id']})" class="no_margin">
                             <span class="icon_com icon6"></span><i>{$r['keep_num']}</i>
                         </a>
                     </div>
                 </div>
             </li>
            </YP:list>   
         </ul>
     </div>

	 <div class="P_mod_btn" id="case2">
         <a href="index.php?g=Mobile&m=Ajax&a=case2">点击加载下4条</a>
     </div>

<!-- tab锚点（共用）4 -->
     <div class="anchor" id="d">
         <div class="point clear">
             <div class="line"></div>
             <div class="sprite_icon Icon">
                 <span class="Icon4 icon_com"></span>
             </div>
             <div class="mes">案例图推荐</div>
             <div class="line line2"></div>
         </div>
     </div>
<!-- 内容 4 -->
 <div id="content3">  
     {php $field='jg_case.id,jg_case.pic,jg_case.title,jg_case.status,jg_case.posid,jg_case.itemType,jg_case.style,jg_case.itemArea,jg_case.budget,jg_user.id as userid,jg_user.avatar,jg_user.username as un';
     $where='jg_case.`status`=1 and jg_case.catid=1 and jg_case.`posid`=1';
     $reluts=M('Case')->field($field)->where($where)->join('jg_user ON jg_case.userid = jg_user.id')->order("jg_case.pos_time desc")->limit('4')->select();}
     
  {php foreach($reluts as $key=>$val):}
     <div class="P_mod_example P_color">
         <div class="section">
             <div class="pic">
                  <a href="index.php?g=Mobile&m=Case&a=show&id={$val['id']}"><img src="{$val['pic']}" alt="" /></a>
             </div>
         
             <div class="info clear">
                 <a href="index.php?g=Mobile&m=Homepage&a=index&id={$val['userid']}">
                 <div class="private">
                     <div class="img">
                         <img  height="50" src="{$val['avatar']}" alt="" />
                     </div>
                     <span class="name">{$val['un']}</span>
                 </div>
                 </a>
                 <div class="mes">
                     <a href="index.php?g=Mobile&m=Case&a=show&id={$val['id']}">
                     <div class="tittle">
                         <h2>{$val['title']}</h2>
                         <p>时尚的现代主义餐厅</p>
                     </div>
                      </a>
                     <div class="type">
                         <p>类型：<YP:list name="Label" where="genre=17" id="v" limit="50">
                         <?php echo $val['itemType'] == $v['id'] ? $v['title'] : ''; ?>
                         </YP:list>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;风格：
                         <YP:list name="Label" where="genre=21" id="v" limit="50">
                             <?php echo $val['style'] == $v['id'] ? $v['title'] : ''; ?>
                         </YP:list></p>
                         <p>面积：{$val.itemArea}㎡&nbsp;&nbsp;&nbsp;&nbsp;造价：{$val['budget']}万元</p>
                        
                     </div>

                    <em><span style="float:right"></span></em>
                 </div>
                 
             </div>
         </div> 
     </div>
{php endforeach;}   
</div>
     <div class="P_mod_btn" id="case1" >
         <a href="index.php?g=Mobile&m=Ajax&a=case1">点击加载下4条</a>
     </div>

<!-- tab锚点（共用）5 -->
     <div class="anchor" id="e">
         <div class="point clear">
             <div class="line"></div>
             <div class="sprite_icon Icon">
                 <span class="Icon5 icon_com"></span>
             </div>
             <div class="mes">餐饮设备推荐</div>
             <div class="line line2"></div>
         </div>
     </div>

<!-- 内容 5 -->
	 <div class="P_mod_effect_catering" >
         <ul class="list clear" id="content4">
         <YP:list name="Product" id="r" where="status=1 and posid=1" order="pos_time desc" limit="4" key="k" >
             
             <li class="part {if $k%2==0}no_margin {/if}">
                 <div class="padding">
                     <div class="pic">
                        <a href="index.php?g=Mobile&m=Product&a=show&id={$r['id']}"><img height="104" src="{$r['pic']}" alt="" /></a>
                     </div>
                     <div class="info"><a href="index.php?g=Mobile&m=Product&a=show&id={$r['id']}">{$r['title']}</a><p><em>￥{$r['price']}</em></p>
                     </div>
                 </div>
             </li>
          </YP:list>   
         </ul>
     </div>

	 <div class="P_mod_btn" id="product">
        <a href="index.php?g=Mobile&m=Ajax&a=product">点击加载下4条</a>
     </div>

<!-- tab锚点（共用）6 -->
     <div class="anchor" id="f">
         <div class="point clear">
             <div class="line"></div>
             <div class="sprite_icon Icon">
                 <span class="Icon6 icon_com"></span>
             </div>
             <div class="mes">餐饮攻略推荐</div>
             <div class="line line2"></div>
         </div>
     </div>

<!-- 内容 6--> 
<div id="content5">
    <YP:list name="News" where="posid=1" catid="14,15,16,17,18,19" order="pos_time desc" limit="3" key="k" id="r">
	 <div class="P_mod_strategy_news P_color">
		 <div class="Padding clear">
			 <div class="pic">
				 <a href="index.php?g=Mobile&m=News&a=show&id={$r.id}"><img src="{$r['pic']}" alt="" /></a>
			 </div>

			 <div class="info">
				 <h2><a href="index.php?g=Mobile&m=News&a=show&id={$r.id}">{$r['title']}</a></h2>
				 <p><a href="index.php?g=Mobile&m=News&a=show&id={$r.id}">{$r['description']|str_cut=###,70}</a></p>
				 <div class="sprite_icon">
					 <span class="icon6 icon_com clear"></span><em class="margin_right">{$r['createtime']|date="Y-m-d H:i:s",###}</em>
					 <span class="icon7 icon_com"></span><em>{$r['hits']}</em>
				 </div>
			 </div>
		 </div>
	 </div>
    </YP:list>
 </div>   
	  <div class="P_mod_btn" id="cygl">
        <a href="index.php?g=Mobile&m=Ajax&a=news_c">点击加载下3条</a>
     </div>

<!-- tab锚点（共用）7 -->
     <div class="anchor" id="g">
         <div class="point clear">
             <div class="line"></div>
             <div class="sprite_icon Icon">
                 <span class="Icon7 icon_com"></span>
             </div>
             <div class="mes">新闻动态</div>
             <div class="line line2"></div>
         </div>
     </div>

<!-- 内容 7-->
	 

<div id="content6">	 
<YP:list name="News" where="posid=1" catid="8" order="pos_time desc" limit="3" key="k" id="r">
	 <div class="P_mod_strategy_news P_color">
		 <div class="Padding clear">
			 <div class="pic">
				<a href="index.php?g=Mobile&m=News&a=show&id={$r.id}"> <img src="{$r['pic']}" alt="" /></a>
			 </div>

			 <div class="info">
				 <a href="index.php?g=Mobile&m=News&a=show&id={$r.id}"><h2>{$r['title']}</h2>
				 <p>{$r['description']|str_cut=###,70}</p></a>
				 <span class="font">{$r['createtime']|date="Y-m-d H:i:s",###}</span>
			 </div>
		 </div>
	 </div>
</YP:list>
</div>
	 <div class="P_mod_btn" id="news_x">
          <a href="index.php?g=Mobile&m=Ajax&a=news_x">点击加载下3条</a>
     </div>


<!-- tab锚点（共用）8 -->
     <div class="anchor" id="h">
         <div class="point clear">
             <div class="line"></div>
             <div class="sprite_icon Icon">
                 <span class="Icon8 icon_com"></span>
             </div>
             <div class="mes">问答推荐</div>
             <div class="line line2"></div>
         </div>
     </div>

<!-- 内容 8-->
	  <YP:list name="Zforum_theme" where="plateid=2" id="r" order="id desc" limit="4">
	   <div class="P_mod_asked P_color">
		 <div class="Padding clear">
			 <div class="asked_num">
				 <span>{$r['reply_num']}</span>
				 <p>回答</p>
			 </div>

			 <div class="info">
				 <a href="index.php?g=Mobile&m=Zforum_reply&a=index&id={$r['id']}&plateid={$r['plateid']}">
                 
                  {php $r['title']=strip_tags($r['title'])}
                  {php $r['content']=strip_tags($r['content'])}
                   <h2>{$r['title']|str_cut=###,40}</h2>
				   <p>{$r['content']|str_cut=###,40}</p></a>
				 <div class="sprite_icon">
					 <span class="icon8 icon_com"></span><em class="margin_right">{$r['createtime']|date="Y-m-d H:i:s",###}</em>
				 </div>
			 </div>
		 </div>
	   </div>
    </YP:list> 
	<!-- <div class="P_mod_btn">
         <a href="javascript:;">点击加载下4条</a>
     </div>
-->

<script type="text/javascript">
function  keep(id){
	
	
		  var module='Case';
		  
		  var url=window.location.search;
		      url='index.php'+url;
		  var title=$(".title h2").html();
		 
      //alert(title);
		  //var userid=$("#keep_u").attr('name');
		 // alert(userid)
	
		  $.post(
				  'index.php?g=User&m=Index&a=keep', 
				  {'id':id,
				   'module':module,
				   'url':url,
				   'title':title,
				   'catid':2
				  },
				  function(res){
					 if(res.length>1000){
						 alert('您还未登录，请您先登录');
						 } else{
							 alert(res)
						      if(res=='收藏成功!'){
							  var keepnum=parseInt($(".keep_n").html())+1;
							  $(".keep_n").html(keepnum);
							  }
						 
						 }
					 
					});
	  
	}





</script>

<!-- tab的滑动 -->
	<script type="text/javascript" src="../Public/js/iscroll.js"></script>
     <script type="text/javascript">
	     function loaded () {
			 var myScroll = new IScroll('#wrapper', {
				 click:true,
				 scrollX: true,
				 scrollY: false
	         });
         }
     </script>
